import { IEvent } from '../type/IEvent';
import { BNode } from '../type/BNode';
export class EventNode extends BNode implements IEvent {
    constructor(public event: string) {
        super();
    }
    onEvent(event: string, data?: any): void {
        if (this.event === event) {
            this.task.done();
        }
    }

    onUpdate(blackBoard?: any): void {
        if (this.event in blackBoard && blackBoard[this.event]) {
            this.task.done();
        }
    }
}
